<!DOCTYPE html>
<html lang="utf-8">
<head>
    <meta charset="utf-8">
    <title>第一个vue应用</title>
    <script src="../js/vue.min.2.7.0.js"></script>
    <style>
        /* 可以设置不同的进入和离开动画 */
        /* 设置持续时间和动画函数 */
        .slide-fade-enter-active {
            transition: all .3s ease;
        }

        .slide-fade-leave-active {
            transition: all .8s cubic-bezier(1.0, 0.5, 0.8, 1.0);
        }

        .slide-fade-enter, .slide-fade-leave-to
            /* .slide-fade-leave-active 用于 2.1.8 以下版本 */
        {
            transform: translateX(10px);
            opacity: 0;
        }

        .bounce-enter-active {
            animation: bounce-in .5s;
        }
        .bounce-leave-active {
            animation: bounce-in .5s reverse;
        }
        @keyframes bounce-in {
            0% {
                transform: scale(0);
            }
            50% {
                transform: scale(1.5);
            }
            100% {
                transform: scale(1);
            }
        }
    </style>
</head>
<body>
<div id="databinding">
    <button v-on:click="show = !show">点我</button>
    <transition name="fade">
        <p v-show="show" v-bind:style="styleObj">动画实例</p>
    </transition>
</div>
<script type="text/javascript">
    var vm = new Vue({
        el: '#databinding',
        data: {
            show: true,
            styleObj: {
                fontSize: '30px',
                color: 'red'
            }
        },
        methods: {}
    });
</script>

<div id="databinding02">
    <button v-on:click="show = !show">点我</button>
    <transition name="slide-fade">
        <p v-if="show">hello</p>
    </transition>
</div>
<script type="text/javascript">
    new Vue({
        el: '#databinding02',
        data: {
            show: true
        }
    })
</script>
</body>
</html>